#if !defined(AFX_SELECTCOMPUTERDIALOG_H__B4DBF4AF_B19D_4862_8507_0B086375B309__INCLUDED_)
#define AFX_SELECTCOMPUTERDIALOG_H__B4DBF4AF_B19D_4862_8507_0B086375B309__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SelectComputerDialog.h : header file
//
#include "stdafx.h"

#pragma warning(push)
#pragma warning(disable : 4786)

//resources
#include "SelectComputerResource.h"

#include "SelectComputerNetwork.h"
#include "Sizer.h"

//std lib
#include <vector>
#include <string>
#include <utility>
//~std lib

using namespace std;

/////////////////////////////////////////////////////////////////////////////
// CSelectComputerDialog dialog

class CSelectComputerDialog : public CDialog
{
// Construction
public:
	CSelectComputerDialog(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CSelectComputerDialog)
	enum { IDD = IDD_SELECT_COMPUTER };
	CListCtrl	m_lstComputers;
	CComboBoxEx	m_cmbLookIn;
	CButton	m_btnOK;
	CButton m_btnCancel;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSelectComputerDialog)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CSelectComputerDialog)
	afx_msg void OnItemchangedList(NMHDR* pNMHDR, LRESULT* pResult);
	virtual BOOL OnInitDialog();
	afx_msg void OnSelchangeCombo();
	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
	afx_msg void OnDropdownCombo();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

public:
	const pair<CString, CString> & GetComputerName() const
	{
		return m_Names[0];
	}

	const vector<pair<CString, CString> >& GetComputerNames() const
	{
		return m_Names;
	}

	bool SingleSelection(bool bSelectionMode = true)
	{	
		bool tmp = m_bSingleSelection;
		m_bSingleSelection = bSelectionMode;
		
		return tmp;
	}

	bool NoALLDomain(bool bOnlyOneDomainInTime = true)
	{
		bool tmp = m_bOnlyOneDomainInTime;
		m_bOnlyOneDomainInTime = bOnlyOneDomainInTime;

		return tmp;
	}

private:
	vector<pair<CString, CString> > m_Names;
	bool	m_bSingleSelection;
	bool	m_bOnlyOneDomainInTime;

private:
	void RefreshListControl(const basic_string<TCHAR>& strDomain);

private:
	bool InitComboBox();
	void InitListControl();
	void InitResizeService();

	vector<basic_string<TCHAR> > m_vecstrDomains;
	vector<basic_string<TCHAR> > m_vecstrServers;

	CSelectComputerNetwork		m_Network;
	CImageList					m_imagelist;

	auto_ptr<CSizerCollection> m_pSizerCollection;	
};

#pragma warning(pop)

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SELECTCOMPUTERDIALOG_H__B4DBF4AF_B19D_4862_8507_0B086375B309__INCLUDED_)
